home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-13
/
amac44a.zip
/
COM001.QM
< prev
next >
Wrap
Text File
|
1992-06-22
|
9KB
|
194 lines
* com001.qm
* Macros to Center and Remove Centered Comments
* Written By Tom Hogshead
* [ See COMTxx.QM For Use ]
* 6/16/92
* Key Subfile Description
* ===== ========= =====================================================
* Center Macro Comment * -- Comment --*
* @5 - Star '*' in Col 5 ( ) |new
* @4 - Star '*' in Col 1
* @8 - Convert @4 Comments to @5 Comments |new
* @7 - Un-Center Comment Made with @4 or @5 |chg
*
* {e:\up\COMT*} Return To COMTxx.QM
*
*-- eoi
* M A C R O S
* ----------------------------------------------------------------------
* @(4) Center macro comment <* -- comment --*>, First Char in in Col 1
* ----------------------------------------------------------------------
* I modified a macro written by Richard Blackburn of SemWare at the
* request of Bob Denhnhardt to comment C programs, to make and center
* macro comment lines. Type comment beginning in column 1. Press @4
* to make it a comment line highlighted with dashes. Comment lines in
* this macro were made with @4.
@4 MacroBegin
setscreenoff setinsmode *|
setrmargin "72" return * Set right margin to 72
* -------------------------- Center Comment --------------------------*
begline unmarkblock
dropanchor dropanchor * To save our place
centerline * Center the line
* -------------------------- Complete Line --------------------------*
gotoblockbeg unmarkblock * Un mark it
cursorleft cursorleft * Cursor left twice
jfalse end * If not end macro, line to long
markcolumn * Begin block
begline * Goto beginning of line
delch delch * Delete ist 2 chars incase Insert on
"* " * Insert '* space' at col 1
markcolumn * Close block
fillblock "-" return * Fill with '-'
copy * Copy to scrap buffer
endline * Pos at eol to paste
cursorright * Space over one
paste endline "*" * Paste block at eol
* ------------------------ Move to Next Line ------------------------*
END: begline * Goto start of comment line
unmarkblock * Un mark it
cursordown * And move down to next line
*
* 45 bytes Fri 03-29-1991 09:30:22
* 47 bytes Mon 05-04-1992 16:08:27 (TH @4, added setscreenoff *|)
*
* ----------------------------------------------------------------------
* @(5) Center Macro Comment <* -- comment --*>, First Char in Col 5
* ----------------------------------------------------------------------
* This macro centers a macro comment with the first char in col 5. It
* differs from @4 which has the first char in col 1.
* Type comment beginning in col 1, no asterisk. Press @5 to center it
* and surround with dashes. Comment lines in this macro were made with
* @5.
@5 macrobegin
setscreenoff setinsmode
setrmargin "67" return * Set right margin to 66
togglewordwrap
gotocolumn '58' return
deltoeol
* -- 123456789012345678901234567890123456789012345678901234567 --*
* ------------------------ Center Comment -----------------------*
begline unmarkblock
dropanchor dropanchor
centerline
* ------------------------ Complete Line ------------------------*
gotoblockbeg unmarkblock * Un mark it
cursorleft cursorleft * Cursor left twice
jfalse END * If not end macro, line to long
markcolumn * Begin block
begline
delch delch * Delete ist 2 chars in case Insert on
"* " * Insert '* space' at col 1
markcolumn * Close block
fillblock "-" return * Fill with '-'
endline * Pos at eol to paste
cursorright * Space over one
unmarkblock markcolumn
gotocolumn '65' return
fillblock return
endline "*"
* ---------------- Shift Right, Move to Next Line ---------------*
END:
unmarkblock
shiftright shiftright * Move comment to col 5
shiftright shiftright
setrmargin '72' return * Reset rt margin
begline cursordown
*
* 73 bytes Mon 06-15-1992 20:42:01 (TH @5, changed @4 to begin in col 5)
*
* ----------------------------------------------------------------------
* @(7) Un_Center Macro Comment
* ----------------------------------------------------------------------
* This macro removes comments made with @4 and @5. Comment must not
* contain "--", and must have "* -" as first character in line. First
* text letter in comment must be in defaultwordset, no * @^ etc.
* ----------------------------- test ----------------------------*
@7 MacroBegin
setscreenoff setinsmode *:15
unmarkblock
defaultwordset * Set default to find first word
begline dropanchor
wordright cursorleft * Move to space before comment
dropanchor * Close block
find "* -" return "lb" return * Test if comment already centered
jfalse END * End macro if not centered
deleteblock * Delete left "* --.." to comment
markline * MarkLine
find "--" return "l" return * Find first dashes rt of cmt *:15
jfalse end * If no dashes, end macro
unmarkblock markcolumn *ELSE Mark first dash right of comment
endline deleteblock * Delete all right "---*"
END:
unmarkblock begline
*
* 47 bytes Wed 04-17-1991 00:28:25
* 49 bytes Tue 08-06-1991 12:41:36 (TH @7, comment cannot have '---')
* 50 bytes Mon 05-04-1992 16:06:42 (TH @7, added setscreenoff v2.15)
* 49 bytes Mon 06-15-1992 20:42:59 (TH @7, shortened)
*
* ----------------------------------------------------------------------
* @(8) Convert @4 Comments to @5 Comments
* ----------------------------------------------------------------------
* This macro will convert comments centered with @4 to comments
* centered with @5. For example, the following commented centered with
* @4 becomes with @8:
* This...
* --------------------------- This a Test ---------------------------*
* Becomes with @8...
* ------------------------- This a Test -------------------------*
@8 macrobegin
setscreenoff setinsmode unmarkblock defaultwordset
markline endline
find '* -' return 'lb' return jfalse END
begline dropanchor wordright cursorleft dropanchor
find return "lb" return jfalse START:
deleteblock markline
find "--" return "l" return jfalse START:
unmarkblock markcolumn endline deleteblock
START:
unmarkblock begline
setrmargin "67" return togglewordwrap
gotocolumn "58" return deltoeol
begline unmarkblock dropanchor dropanchor
centerline
gotoblockbeg unmarkblock
cursorleft cursorleft jfalse SHIFT:
markcolumn begline delch delch "* " markcolumn
fillblock "-" return
endline cursorright
unmarkblock
markcolumn gotocolumn "65" return fillblock return endline "*"
SHIFT:
unmarkblock
shiftright shiftright shiftright shiftright
setrmargin "72" return
begline cursordown
END:
unmarkblock
find '--*' return delline return * Move to next centered cmt line
begline
*
* 140 bytes Sun 06-21-1992 18:53:52 (TH @8)
* ------------------------------- test -------------------------------*